import { createApp } from 'vue'
import './style.css'
import App from './App.vue'

// 导入api
import api from './api/api'
// 导入路由
import router from './router'
// 导入element-plus
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// 注册api
window.$api = api

// 初始化vue App
const app = createApp(App)

// 全局引入icon库
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

// 全局引入路由router和element-plus
app.use(router).use(ElementPlus, { locale: zhCn, }).mount('#app')